<template>
	<view>
		<view class="head">
			<view style="height: 32rpx;width: 1rpx;"></view>
			<view class="user-info" :style="[{ paddingTop: safeTop }, { height: menuH }, { lineHeight: menuH }]">
				<view class="info" @click="$authTo('/pages/userInfo/userInfo')">
					<view class="user-img">
						<image :src="$oss(info.avatar)" mode="aspectFill"></image>
					</view>
					<view class="user-names">
						<view class="name">{{info.nickname}}</view>
						<view class="mobile">手机号：{{info.mobile}}</view>
					</view>
				</view>
				<view :style="[{ marginTop: perch }]" class="set-btn" @click="$skip('/pages/set/set')">账户设置</view>
			</view>
			<view class="fansS" @click="$authTo('/pages/concern-fans/concern-fans')">
				<view class="fans"> 粉丝 <text>{{info.fans_count}}</text> </view>
				<view class="fans"> 关注 <text>{{info.follow_count}}</text> </view>
			</view>
			<view style="height: 55rpx;width: 100%;"></view>
		</view>
		
		<view class="member-box">
			<image class="member-img" src="../../static/my/member.png" mode=""></image>
			<view class="member-l">
				<view class="member-name">会员充值</view>
				<view class="member-text">充值会员享受更多优惠</view>
			</view>
			<view class="member-r">立即充值</view>
		</view>
		
		<view class="tow-card">
			<view class="card-each" @click="$authTo('/pages/myOrder/myOrder')">
				<image class="card1-img" src="../../static/my/card1.png" mode=""></image>
				<view class="card-l">
					<view class="card-name">我的订单</view>
					<view class="card-text">查看订单</view>
				</view>
				<image class="card1-r-img" src="../../static/my/card1-l.png" mode=""></image>
			</view>
			<view class="card-each" @click="$authTo('/pages/myBooking/myBooking')">
				<image class="card1-img" src="../../static/my/card2.png" mode=""></image>
				<view class="card-l">
					<view class="card-name">我的预订</view>
					<view class="card-text">查看预定</view>
				</view>
				<image class="card1-r-img" src="../../static/my/card2-l.png" mode=""></image>
			</view>
		</view>
		
		<view class="money-box">
			<view class="money-each" @click="$authTo('/pages/MyBalance/MyBalance')">
				<view class="name">余额</view>
				<view class="text">余额(元)</view>
			</view>
			<view class="rod"></view>
			<view class="money-each" @click="$authTo('/pages/Coupons/Coupons')">
				<view class="name">{{info.coupon_count}}</view>
				<view class="text">优惠券</view>
			</view>
			<view class="rod"></view>
			<view class="money-each" @click="$authTo('/pages/PlayCard/PlayCard')">
				<view class="name">
					<image class="free-img" src="../../static/my/free-img.png" mode=""></image>
				</view>
				<view class="text green">畅达卡</view>
			</view>
		</view>
		
		<view class="item-box">
			<view class="item-title">
				<view class="title-l">助教订单</view>
				<view class="title-r" @click="$authTo('/pages/tutorOrder/tutorOrder')">查看更多 <u-icon name="arrow-right" size="12"></u-icon> </view>
			</view>
			<view class="item-each-box">
				<view class="item-each" @click="tutorOrder(1)">
					<image class="item-img" src="../../static/my/item1.png" mode=""></image>
					<view class="item-text">待付款</view>
				</view>
				<view class="item-each" @click="tutorOrder(2)">
					<image class="item-img" src="../../static/my/item2.png" mode=""></image>
					<view class="item-text">待服务</view>
				</view>
				<view class="item-each" @click="tutorOrder(3)">
					<image class="item-img" src="../../static/my/item10.png" mode=""></image>
					<view class="item-text">进行中</view>
				</view>
				<view class="item-each" @click="tutorOrder(4)">
					<image class="item-img" src="../../static/my/item3.png" mode=""></image>
					<view class="item-text">评价</view>
				</view>
				<view class="item-each" @click="tutorOrder(5)">
					<image class="item-img" src="../../static/my/item4.png" mode=""></image>
					<view class="item-text">退单</view>
				</view>
			</view>
		</view>
		
		<view class="item-box">
			<view class="item-title">
				<view class="title-l">其他</view>
				<view class="title-r"></view>
			</view>
			<view class="item-each-box">
				<view class="item-each">
					<image class="item-img" src="../../static/my/item5.png" mode=""></image>
					<view class="item-text">门店</view>
				</view>
				<view class="item-each" @click="$authTo('/pages/cooperate/cooperate')">
					<image class="item-img" src="../../static/my/item6.png" mode=""></image>
					<view class="item-text">品牌合作</view>
				</view>
				<view class="item-each" @click="$authTo('/pages/fault-Report/fault-Report')">
					<image class="item-img" src="../../static/my/item7.png" mode=""></image>
					<view class="item-text">故障上报</view>
				</view>
				<view class="item-each" @click="$authTo('/pages/tutorEnter/tutorEnter')">
					<image class="item-img" src="../../static/my/item8.png" mode=""></image>
					<view class="item-text">助教入驻</view>
				</view>
				<view class="item-each" @click="$skip('/pages/kefu/kefu')">
					<image class="item-img" src="../../static/my/item9.png" mode=""></image>
					<view class="item-text">联系客服</view>
				</view>
			</view>
		</view>
		
		<view style="height: 32rpx;width: 1rpx;"></view>
		
		<view style="height: 160rpx;width: 1rpx;"></view>
		<tabbar :current-page="2"></tabbar>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				menuH:this.$menuH || '',
				safeTop: this.$safeTop || 20 + 'px',
				perch:this.$perch + 20 + 'px' || '',
				info:{}
			}
		},
		onShow() {
			this.getInfo()
		},
		methods: {
			getInfo() {
				this.$api.post('/getUserInfo').then((res) => {
					if(res.data){
						this.info = res.data
					}
				}).catch((res) => {});
			},
			tutorOrder(e){
				this.$authTo('/pages/tutorOrder/tutorOrder?state=' + e)
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #F7F8FA;
	}
	.head {
		width: 750rpx;
		background: linear-gradient(to bottom, #E0F2F3,#E5F4F5, #F7F8FA);
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		
		.user-info {
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 0 32rpx;
			.info {
				display: flex;
			}
			.user-img {
				width: 120rpx;
				height: 120rpx;
				background: #D9D9D9;
				border-radius: 50%;
				image {
					width: 120rpx;
					height: 120rpx;
					border-radius: 50%;
				}
			}
			.user-names {
				margin-left: 32rpx;
				.name {
					font-weight: bold;
					font-size: 48rpx;
					color: #203460;
				}
				.mobile {
					font-weight: 500;
					font-size: 26rpx;
					color: #A3ABB9;
					margin-top: 8rpx;
				}
			}
			.set-btn {
				width: 152rpx;
				height: 56rpx;
				background: #FFFFFF;
				border-radius: 28rpx 28rpx 28rpx 28rpx;
				font-weight: 500;
				font-size: 22rpx;
				color: #6B738B;
				line-height: 56rpx;
				text-align: center;
			}
		}
		
		.fansS {
			display: flex;
			padding: 70rpx 32rpx 0 56rpx;
			font-weight: 500;
			font-size: 28rpx;
			color: #A4A9B7;
			.fans {
				margin-right: 100rpx;
				text {
					font-weight: bold;
					font-size: 44rpx;
					color: #1C274C;
					padding-left: 16rpx;
				}
			}
		}
	}
	
	.member-box {
		width: 606rpx;
		margin: auto;
		padding: 30rpx 40rpx;
		position: relative;
		.member-img {
			width: 686rpx;
			height: 144rpx;
			position: absolute;
			top: 0;
			left: 0;
		}
		display: flex;
		justify-content: space-between;
		align-items: center;
		.member-l {
			z-index: 1;
			.member-name {
				font-weight: 800;
				font-size: 32rpx;
				color: #FFFFFF;
			}
			.member-text {
				font-weight: 500;
				font-size: 22rpx;
				color: rgba(255,255,255,0.7);
				margin-top: 8rpx;
			}
		}
		.member-r {
			z-index: 1;
			width: 153rpx;
			height: 56rpx;
			background: #FFFFFF;
			border-radius: 28rpx 28rpx 28rpx 28rpx;
			font-weight: bold;
			font-size: 26rpx;
			color: #4BC264;
			text-align: center;
			line-height: 56rpx;
		}
	}
	
	.tow-card {
		padding: 32rpx;
		display: flex;
		justify-content: space-between;
		// margin-top: 32rpx;
		.card-each {
			width: 331rpx;
			// height: 150rpx;
			background: rgba(242,247,255,0.5);
			border-radius: 30rpx 30rpx 30rpx 30rpx;
			margin: auto;
			padding: 34rpx 32rpx;
			position: relative;
			
			.card1-img {
				width: 331rpx;
				height: 150rpx;
				position: absolute;
				top: 0;
				left: 0;
			}
			display: flex;
			justify-content: space-between;
			// align-items: center;
			.card-l {
				z-index: 1;
				.card-name {
					font-weight: bold;
					font-size: 30rpx;
					color: #1C274C;
				}
				.card-text {
					font-weight: 500;
					font-size: 22rpx;
					color: #A4A9B7;
					margin-top: 8rpx;
				}
			}
			.card1-r-img {
				width: 87rpx;
				height: 87rpx;
			}
		}
	}
	
	.money-box {
		width: 622rpx;
		height: 164rpx;
		background: #FFFFFF;
		border-radius: 30rpx 30rpx 30rpx 30rpx;
		margin: auto;
		display: flex;
		justify-content: space-around;
		align-items: center;
		padding: 0 32rpx;
		.money-each {
			text-align: center;
			.name {
				font-weight: bold;
				font-size: 40rpx;
				color: #1C274C;
				.free-img {
					width: 48rpx;
					height: 48rpx;
				}
			}
			.text {
				font-weight: 500;
				font-size: 24rpx;
				color: #6B738B;
				margin-top: 16rpx;
			}
			.green {
				color: #4BC264;
			}
		}
		.rod {
			width: 1rpx;
			height: 39rpx;
			background-color: #F3F3F3;
		}
	}
	
	.item-box {
		padding: 32rpx;
		width: 622rpx;
		background: #FFFFFF;
		border-radius: 24rpx 24rpx 24rpx 24rpx;
		margin: auto;
		margin-top: 32rpx;
		.item-title {
			display: flex;
			justify-content: space-between;
			.title-l {
				font-weight: bold;
				font-size: 30rpx;
				color: #1C274C;
			}
			.title-r {
				display: flex;
				font-weight: 500;
				font-size: 22rpx;
				color: #A4A9B7;
			}
		}
		.item-each-box {
			display: flex;
			justify-content: space-between;
			margin-top: 32rpx;
			.item-each {
				text-align: center;
				.item-img {
					width: 56rpx;
					height: 56rpx;
				}
				.item-text {
					font-weight: 500;
					font-size: 24rpx;
					color: #1C274C;
					margin-top: 12rpx;
				}
			}
		}
	}
</style>
